<?php

// +---------------------------------------------------
// | Name： 星空框架 广告验证规则
// +---------------------------------------------------
// | Version： V5.0
// +---------------------------------------------------
// | Author: xkyinzhe <zhonghuaxinxing@sina.cn>
// +---------------------------------------------------
// | Time: 2021-04-22 09:07
// +---------------------------------------------------
declare(strict_types=1);

namespace app\common\validate;

use think\Validate;

/**
 * @xk 广告验证规则
 */
class Banner extends Validate
{
    protected $rule = [
  'banner_id' => 'number|min:1',
  'banner_type_id' => 'number|min:1',
  'banner_name' => 'require|min:2|max:100',
  'show_type' => 'number|in:1,2',
  'fileurl' => 'require',
  'order_id' => 'number|min:0',
  'status' => 'in:0,1',
  ];
    protected $message = [
  'banner_id' => '请选择需要操作的广告',
  'banner_type_id.number' => '请选择所属广告为',
  'banner_name.require' => '请填写广告名称',
  'show_type' => '请选择广告类型',
  'fileurl' => '请上传广告图片/视频',
  'order_id.number' => '请按照规则填写排序ID',
  'status' => '广告位状态不符合规则',
  ];
    protected $scene = [
  'create' => ['banner_type_id', 'banner_name', 'show_type', 'fileurl', 'order_id', 'status'],
  'edit' => ['banner_id', 'banner_type_id', 'banner_name', 'show_type', 'fileurl', 'order_id', 'status'],
  ];
}
